import {createRouter, createWebHistory} from 'vue-router'
import Home from '@/views/Home.vue'
import Square from "@/components/Square";
import Center from "@/components/Center";
import Ring from "@/components/Ring";
import Friend from "@/components/Friend";
import Setting from "@/components/Setting";
import RingDetail from "@/components/RingDetail";
import SquareDetail from "@/components/SquareDetail";

const routes = [
    {
        path: '/',
        name: 'main',
        component: Center,
        children: [
            {
                path: '/', component: Square
            },
            {
                path: '/Square', component: Square
            },
            {
                path: '/Ring', component: Ring
            },
            {path: '/SquareDetail', component: SquareDetail, name: 'SquareDetail'},
            {path: '/RingDetail', component: RingDetail, name: 'RingDetail'},
            {
                path: '/Friend', component: Friend
            },
            {
                path: '/Setting', component: Setting
            }
        ]
    }

]

const router = createRouter({
    routes,
    history: createWebHistory(process.env.BASE_URL),
    scrollBehavior() {
        return {top: 0}
    }
})

export default router
